import request from '@/utils/request'

// 获取角色列表
export async function getRoleList(params: any) {
  return request('/api/platform/rolesList', {
    method: 'GET',
    params
  })
}

// 获取角色菜单
export async function getRoleMenu(params: any) {
  return request('/api/backend/getMenuSelectList', {
    method: 'GET',
    params
  })
}

// 新增角色
export async function addRole(params: any) {
  return request('/api/platform/addRole', {
    method: 'POST',
    data: params
  })
}

// 获取编辑角色详情
export async function getEditInfo(params: any) {
  return request('/api/platform/getInfo', {
    method: 'GET',
    params
  })
}

// 编辑角色
export async function updateRole(params: any) {
  return request('/api/platform/updateRole', {
    method: 'POST',
    data: params
  })
}

// 删除角色
export async function delRole(params: any) {
  return request('/api/platform/delRole', {
    method: 'POST',
    data: params
  })
}
